const { invalidGoodsID } = require('../constant/err.type')
const validator = async (ctx, next) => {
    try {
        ctx.verifyParams({
            // goods_id: { type: 'number', required: true },
            goods_id: "number"
        })
    } catch (err) {
        // console.log(err)
        console.error("", err.errors);
        invalidGoodsID.result = err.errors
        return ctx.app.emit("error", invalidGoodsID, ctx)
    }
    await next();
}
module.exports = {
    validator,
}